/**
 * Copyright (C), 2018-2018, https://blog.fundodoo.com
 * Author:   醉探索戈壁
 * Date:     2018/6/20 下午8:11
 * Description: 测试Wings配置控制器
 * History:
 * <author>          <time>          <version>          <desc>
 * 作者姓名           修改时间           版本号              描述
 */
package com.fundodoo.blog.drunk2.controller;

import com.fundodoo.blog.drunk2.properties.DrunkProperties;
import com.fundodoo.blog.drunk2.properties.WingsProperties;
import com.fundodoo.blog.drunk2.properties.WingsYaml;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 *
 * @author 醉探索戈壁
 * @create 2018/6/20 下午8:11
 * @since 1.0.0
 */
@RestController
public class PropertiesController {

    private final WingsProperties wingsProperties;

    private final DrunkProperties drunkProperties;

    private final WingsYaml wingsYaml;

    @Autowired
    public PropertiesController(WingsProperties wingsProperties,DrunkProperties drunkProperties,WingsYaml wingsYaml){
        this.wingsProperties = wingsProperties;
        this.drunkProperties = drunkProperties;
        this.wingsYaml = wingsYaml;
    }

    @GetMapping("/wings")
    public WingsProperties getWingsProperties(){
        System.out.println(wingsProperties.toString());
        return wingsProperties;
    }

    @GetMapping("/drunk")
    public DrunkProperties getDrunkProperties(){
        System.out.println(drunkProperties.toString());
        return drunkProperties;
    }

    @GetMapping("/wy")
    public WingsYaml getWingsYaml(){
        System.out.println(wingsYaml.toString());
        return wingsYaml;
    }

}
